package com.example.BlockChain.service.impl;

import com.example.BlockChain.dao.UserDao;
import com.example.BlockChain.entity.TUser;
import com.example.BlockChain.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    @Override
    public int add(TUser user) {return userDao.add(user);}
    @Override
    public TUser queryUser(TUser tuser) {return userDao.queryUser(tuser);}//登录

    @Override
    public TUser queryUserByUsername(String username) {
        return userDao.queryUserByUsername(username);
    }
    @Override
    public List<TUser> getAllStores(String role){return userDao.queryStores(role);}

    @Override
    public TUser getUser(int userid){return userDao.queryUser1(userid);}
    @Override
    public String getAdress(int userid){return userDao.queryUserAddressByUserid(userid);}

    @Override
    public TUser getUserById(int userid) {
        // 调用 DAO 层方法获取用户信息
        return userDao.getUserById(userid);
    }
}
